package so.wy.servicecenter.businessbed.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import so.wy.servicecenter.base.frame.web.AbstractWeb;
import so.wy.servicecenter.base.frame.web.webhand.WebExceptionHandler;
import so.wy.servicecenter.businessbed.dao.rdb.statics.*;
import so.wy.servicecenter.businessbed.service.statics.BedStaticsService;
import so.wy.servicecenter.businessbed.service.statics.dto.ItemOrderDeviceStaticsDTO;
import so.wy.servicecenter.businessbed.service.statics.dto.TodayStaticsDTO;
import so.wy.servicecenter.businessbed.service.statics.dto.TotalStaticsDTO;

import java.util.List;

@Service
@Scope("prototype")
public class BedStaticsWeb extends AbstractWeb {
    @Autowired
    private BedStaticsService staticsService;

    //1、总订单量
    //2、总订单金额，总实际支付金额，总免单金额
    //3、当前押金池金额 当前总充值用户数
    //4、总床数量 总投放床数量
    @WebExceptionHandler
    public TotalStaticsDTO getTotalStatics() {
        return staticsService.getTotalStatics();
    }

    //医院总信息
    @WebExceptionHandler
    public List<ItemOrderDeviceStaticsDTO> getTotalHospitalInfo() {
        return staticsService.getTotalHospitalInfo();
    }

    //最近一个月总订单量变化趋势
    @WebExceptionHandler
    public List<OrderLineStaticsDO> totalDayOrderCountLineLastMonth() {
        return staticsService.totalDayOrderCountLineLastMonth();
    }

    //7、充值用户变化趋势
    @WebExceptionHandler
    public List<UserLineStaticsDO> totalCzUserCountLine() {
        return staticsService.totalCzUserCountLine();
    }

    //统计当天的一些信息
    @WebExceptionHandler
    public TodayStaticsDTO getTodayInfo() {
        return staticsService.getTodayInfo();
    }

    @WebExceptionHandler
    //4、医院当日订单信息（总订单量，订单金额，实际支付金额）
    public List<OrderWdStaticsDO> todayOrderInfoGroupHospital() {
        return staticsService.todayOrderInfoGroupHospital();
    }

    //医院维度
    @WebExceptionHandler
    public TotalStaticsDTO getTotalHospitalStatics(Long hospitalId){
        return staticsService.getTotalHospitalStatics(hospitalId);
    }

    @WebExceptionHandler
    public TodayStaticsDTO getTodayHospitalInfo(Long hospitalId){
        return staticsService.getTodayHospitalInfo(hospitalId);
    }

    //2、各楼层 投放床数量 总订单量
    @WebExceptionHandler
    public List<ItemOrderDeviceStaticsDTO> getTotalFloorInfo(Long hospitalId) {
        return staticsService.getTotalFloorInfo(hospitalId);
    }

    //3、各科室 投放床数量 总订单量
    @WebExceptionHandler
    public List<ItemOrderDeviceStaticsDTO> getTotalDepartInfo(Long hospitalId) {
        return staticsService.getTotalDepartInfo(hospitalId);
    }

    @WebExceptionHandler
    public List<OrderLineStaticsDO> totalDayHospitalOrderCountLineLastMonth(Long hospitalId) {
        return staticsService.totalDayHospitalOrderCountLineLastMonth(hospitalId);
    }

    //4、各楼层 订单量变化趋势
    @WebExceptionHandler
    public List<OrderLineStaticsDO> totalDayOrderCountLineLastMonthGroupFloor(Long floorId) {
        return staticsService.totalDayOrderCountLineLastMonthGroupFloor(floorId);
    }

    //5、各科室 订单量变化趋势
    @WebExceptionHandler
    public List<OrderLineStaticsDO> totalDayOrderCountLineLastMonthGroupDepart(Long departId) {
        return staticsService.totalDayOrderCountLineLastMonthGroupDepart(departId);
    }

}
